﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using ChuckNorris.Models;
using ChuckNorris.ViewModels;
using ImpromptuInterface.MVVM;
using Microsoft.Practices.Unity;
using ImpromptuInterface.MVVM.Unity;
namespace ChuckNorris.Unity
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
           
            var unityContainer = new UnityContainer();
            unityContainer.RegisterType<IWebService, ChuckNorrisWebService>();
           
            var impromptuContainer = new Container(unityContainer, typeof (IUnityContainer));
            impromptuContainer.AddView("Main", typeof (MainView), typeof (MainViewModel));
           
            var runtime = Runtime.Initialize().SetupContainer(impromptuContainer) ;
            runtime.Start.Main();

        }
    }
}
